package com.aaa.service.impl;

import com.aaa.mapper.EmpMapper;
import com.aaa.pojo.Emp;
import com.aaa.service.EmpService;
import com.aaa.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: ssm
 * @description:
 * @author: 闫克起2
 * @create: 2023-04-08 16:35
 **/
@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpMapper empMapper;
    @Override
    public Result queryById(Integer empId) {
        Emp emp = empMapper.findById(empId);
        return new Result(200,"查询员工信息成功",emp);
    }

    @Override
    public Result queryAll() {
        List<Emp> emps = empMapper.findAll();
        return new Result(200,"查询所有员工信息",emps);
    }
}
